package com.lee.bgTask.entity.impl;

import com.lee.bgTask.entity.TaskEntity;

import java.util.Map;

public class AbstractTaskEntity implements TaskEntity {

    private String taskName;

    private int index;

    private Map<String, Object> varibales;

    private volatile Status status;

    private FailedStrategy failedStrategy;

    public AbstractTaskEntity() {
        this.failedStrategy = FailedStrategy.NOTHING;
    }

    public AbstractTaskEntity(String taskName) {
        this.taskName = taskName;
        this.failedStrategy = FailedStrategy.NOTHING;
    }

    public AbstractTaskEntity(String taskName, FailedStrategy failedStrategy) {
        this.taskName = taskName;
        this.failedStrategy = failedStrategy;
    }

    @Override
    public void onExcute(){
    }

    @Override
    public int queueHash() {
        return 0;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public Map<String, Object> getVaribales() {
        return varibales;
    }

    public void setVaribales(Map<String, Object> varibales) {
        this.varibales = varibales;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public FailedStrategy getFailedStrategy() {
        return failedStrategy;
    }

    public void setFailedStrategy(FailedStrategy failedStrategy) {
        this.failedStrategy = failedStrategy;
    }
}
